package day4.car;

/**
 * @author oldliu
 * @since 1.0
 */
public class Driver {
    String name;
    public Driver(String n){
        name=n;
    }
    //驾驶方法
    public void drive(Car c){
        System.out.println("司机"+name+"开着小轿车在马路上浪");
        c.start();
        c.running();
    }
    public void drive(Truck c){
        System.out.println("司机"+name+"开着货车，糊口");
        c.carry();
    }
    public void drive(Bus c){
        System.out.println("司机"+name+"开着公交车"+c.line);
        c.work();
    }
//    public void drive(){
//        Bus c=new Bus("118","河钢","大蜀山");
//        c.work();
//    }
}
